package d3d9;

import org.bridj.Pointer;
import org.bridj.ValuedEnum;
import org.bridj.ann.Convention;
import org.bridj.ann.Convention.Style;
import org.bridj.ann.Library;
import org.bridj.ann.Runtime;
import org.bridj.ann.Virtual;
import org.bridj.cpp.com.COMRuntime;
import org.bridj.cpp.com.IID;
import org.bridj.cpp.com.IUnknown;

import windows.HMONITOR;
import windows.HWND;

import d3d9.D3D9.D3DDEVTYPE;
import d3d9.D3D9.D3DFORMAT;
import d3d9.D3D9.D3DMULTISAMPLE_TYPE;
import d3d9.D3D9.D3DRESOURCETYPE;

@IID("81BDCBCA-64D4-426d-AE8D-AD0147F4275C")
@Library("d3d9")
@Runtime(COMRuntime.class)
@Convention(Style.StdCall)
public class IDirect3D9 extends IUnknown {

	@Virtual(3)
	public native final int RegisterSoftwareDevice(Pointer<?> pInitializeFunction);
    
	@Virtual(4)
	public native final int GetAdapterCount();
	
	@Virtual(5)
	public native final int GetAdapterIdentifier(int Adapter, int Flags, Pointer<D3DADAPTER_IDENTIFIER9> pIdentifier);
	
	@Virtual(6)
	public native final int GetAdapterModeCount(int Adapter, ValuedEnum<D3DFORMAT> Format);
	
	@Virtual(7)
	public native final int EnumAdapterModes(int Adapter, ValuedEnum<D3DFORMAT> Format, int Mode, Pointer<D3DDISPLAYMODE> pMode);
	
	@Virtual(8)
	public native final int GetAdapterDisplayMode(int Adapter, Pointer<D3DDISPLAYMODE> pMode);
	
	@Virtual(9)
	public native final int CheckDeviceType(int Adapter, ValuedEnum<D3DDEVTYPE> DevType, ValuedEnum<D3DFORMAT> DisplayFormat, ValuedEnum<D3DFORMAT> BackBufferFormat, int bWindowed);
	
	@Virtual(10)
	public native final int CheckDeviceFormat(int Adapter, ValuedEnum<D3DDEVTYPE> DevType, ValuedEnum<D3DFORMAT> AdapterFormat, int Usage, ValuedEnum<D3DRESOURCETYPE> RType, ValuedEnum<D3DFORMAT> CheckFormat);
	
	@Virtual(11)
	public native  final int CheckDeviceMultiSampleType(int Adapter, ValuedEnum<D3DDEVTYPE> DeviceType, ValuedEnum<D3DFORMAT> SurfaceFormat, int Windowed, ValuedEnum<D3DMULTISAMPLE_TYPE> MultiSampleType, Pointer<Integer> pQualityLevels);
	
	@Virtual(12)
	public native final int CheckDepthStencilMatch(int Adapter, ValuedEnum<D3DDEVTYPE> DeviceType, ValuedEnum<D3DFORMAT> AdapterFormat, ValuedEnum<D3DFORMAT> RenderTargetFormat, ValuedEnum<D3DFORMAT> DepthStencilFormat);
	
	@Virtual(13)
	public native final int CheckDeviceFormatConversion(int Adapter, ValuedEnum<D3DDEVTYPE> DeviceType, ValuedEnum<D3DFORMAT> SourceFormat, ValuedEnum<D3DFORMAT> TargetFormat); 
	
	@Virtual(14)
	public native final int GetDeviceCaps(int Adapter, ValuedEnum<D3DDEVTYPE> DeviceType, Pointer<D3DCAPS9> pCaps);
	
	@Virtual(15)
	public native final HMONITOR GetAdapterMonitor(int Adapter);
	
	@Virtual(16)
	public native final int CreateDevice(int Adapter, ValuedEnum<D3DDEVTYPE> DeviceType, HWND hFocusWindow, int BehaviorFlags, Pointer<D3DPRESENT_PARAMETERS> pPresentationParameters, Pointer<Pointer<IDirect3DDevice9>> ppReturnedDeviceInterface);
}
